﻿using System;

namespace SerialManager.Loaders
{
    /// <summary>
    /// <see cref="IEpisodeLoader.Status"/> of loader
    /// </summary>
    public enum EpisodeLoaderStatus
    {
        Initialized = 0,
        Started = 1,
        Aborted = 2,
        DoneWithError = 3,
        DoneSuccessful = 4
    }

    /// <summary>
    /// Reason of aborting loader
    /// </summary>
    public enum EpisodeLoaderAbortReason
    {
        Unknown,
        NotNeeded,
        Timeout,
        UserAborted
    }

    /// <summary>
    /// Interface for implementing loader of information about serial
    /// </summary>
    public interface IEpisodeLoader
    {
        /// <summary>
        /// Thread method used for starting loader
        /// </summary>
        void Start();
        /// <summary>
        /// Method called when user wants abort loading informations
        /// </summary>
        void Abort(EpisodeLoaderAbortReason reason);
        /// <summary>
        /// Indicates, that loading has finished successfully
        /// </summary>
        bool Finished { get; }
        /// <summary>
        /// Current status of loader processing
        /// </summary>
        EpisodeLoaderStatus Status { get; }
        /// <summary>
        /// Number of seasons, that were loaded
        /// </summary>
        int SeasonCount { get; }
        /// <summary>
        /// Informations about episodes, that were loaded
        /// </summary>
        System.Collections.Generic.List<EpisodeInfo> Episodes { get; }
    }
}
